﻿using Microsoft.AspNetCore.Mvc.Filters;
using Single.Logger;

namespace Single.WebApp.Components
{
    public class WorkExceptionFilter : IAsyncExceptionFilter
    {
        public Task OnExceptionAsync(ExceptionContext context)
        {
            Exception ex = context.Exception;

            LoggerHelper.Error(ex.Message, ex);

            return Task.CompletedTask;
        }
    }
}